<template>
  <div>
   <h1>02v-bind</h1>
   <p>名字:{{name}}</p>
   <!-- <img v-bind:src="ImUrl" alt=""> -->
   <!-- 简写 -->
   <img :src="ImUrl" alt="">

  <div id="box" v-on:click='doClick'></div>

  </div>
</template>

<script>
// v-bind动态绑定标签额属性值
export default {
  data() {
    return {
      name:'张三',
      ImUrl:'https://img0.baidu.com/it/u=2862534777,914942650&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500'
    }
  },
  methods: {
    doClick(){
      alert('你好')
    }
  },
}
</script>
<style>
  #box{
    width: 200px;
    height: 200px;
    background-color: red;

  }
</style>


